package kr.co.doriclassic.powerjava.chapter20;

import java.util.Calendar;
import java.util.Date;

public class DateEx {
	public static void main(String[] args) {
		Date d = new Date();
		System.out.println(d);
		System.out.println(1900+d.getYear());//년, 사향될 가능성이 있다.
		System.out.println(d.getMonth()+1);//월, 0부터 시작
		System.out.println(d.getDate());//일
		
		
		Calendar cl = Calendar.getInstance();
		System.out.println(cl);
		System.out.println(cl.get(Calendar.YEAR)+"년");
		System.out.println(cl.get(Calendar.MONTH)+1+"월");
		System.out.println(cl.get(Calendar.DATE)+"일");
		
		System.out.println("올해도 " +cl.get(Calendar.DAY_OF_YEAR)+"일 지났음");
		
	}
}
